package com.tywj.lib.core.common.extension

import android.view.View
import android.view.ViewGroup

/**
 * <pre>
 *     author : June Yang
 *     time   : 2020/5/7
 *     desc   : ViewGroup扩展
 *     version: 1.0.0
 * </pre>
 */
fun ViewGroup.gone(vararg arr: View) {
    arr.forEach {
        if (it.visibility != View.GONE) {
            it.visibility = View.GONE
        }
    }
}

fun ViewGroup.visible(vararg arr: View) {
    arr.forEach {
        if (it.visibility != View.VISIBLE) {
            it.visibility = View.VISIBLE
        }
    }
}

fun ViewGroup.invisible(vararg arr: View) {
    arr.forEach {
        if (it.visibility != View.INVISIBLE) {
            it.visibility = View.INVISIBLE
        }
    }
}